from selenium.webdriver.common.by import By

from Common.Utils import BlogDriver
#博客首页测试用例
class BlogDetail:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://192.168.47.135:8653/blog_system/blog_detail.html?blogId=16"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)

    #登录状态下博客详细页的测试
    def DetailTestBylogin(self):
        # 检查标题
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.right > div.blog-title")

        # 检查时间
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.right > div.blog-time")

        # 检查内容
        self.driver.find_element(By.CSS_SELECTOR, "#content > p")

        # 屏幕截图
        BlogDriver.getScreenShot()